{extend name="layout/layout" /}

{block name="pagecss"}
<style>

    #upload-image img {
        width: 100px;
        height: 100px;
        cursor: pointer;
        border: 1px solid #ccc;
    }
    #edui1_imagescale{display:none !important;}  /*点击上传的图片后出现的拉伸边框*/
    .edui-editor-bottomContainer{display: none;}

</style>
{/block}

{block name="content"}
<div class="row">
    <div class="col-md-12">
        <div class="portlet light">
            <div class="portlet-title">
                <div class="caption">
                    <i class="icon-share font-dark"></i>
                    <span class="caption-subject font-dark bold uppercase"> {$title}</span>
                </div>
                <div class="actions">
                    <a class="btn btn-circle btn-icon-only btn-default fullscreen" href="javascript:;" data-original-title="" title=""> </a>
                </div>
            </div>
            <div class="portlet-body">
                <form action="{:url('admin/'.strtolower($model).'/addclasshour')}" class="form-horizontal validation-form" method="post" enctype="multipart/form-data">
                    {:token()}
                    <div class="form-body">
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        课时名称
                                        <span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <input type="text" class="form-control" id="name" maxlength="40" placeholder="最多输入40字" name="name" value="" >
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        课时文件
                                    </label>
                                    <div class="col-md-9">
                                        <div id="upload-image">
                                            <span id="upload-btn" data-multi="false" data-extensions="jpg,jpeg,png,pdf,mp4,mp3" data-max_file_size="10M">
                                                <!--<input type="hidden" class="form-control" id="coverImg" data-required="1" name="coverImg" value="">-->
                                                <!--<img src="{$info.imgUrl|default='__STATIC__/admin/img/picbg2.png'}" alt="图片上传" style="width: 100px;height: 100px;" />-->
                                                <div class="uploader-div">
													<span class="icon">+</span>
													<small></small>
												</div>
                                            </span>
                                        </div>
                                        <div class="help-block" style="display: none;">
                                            <input type="text" class="form-control" data-required="1" name="fileUrl" value="" disabled>
                                        </div>
                                        <span class="help-inline">支持jpg、jpeg、png、pdf、mp4、mp3格式，mp4、mp3大小不超过10M</span>
                                        <input type="hidden" name="fileName" value="">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        课时排序
                                    </label>
                                    <div class="col-md-9">
                                        <input type="number" class="form-control" id="sorting" name="sorting" value="1" >
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--<div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        课时文件简介
                                    </label>
                                    <div class="col-md-9">
                                        <textarea type="fileDesc" class="form-control" id="fileDesc" name="fileDesc"></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>-->

                        <input type="hidden" name="classId" value="{$classId}">

                        <hr />
                        <div class="row">
                            <div class="form-actions">
                                <div class="col-md-offset-2 col-md-10">
                                    <button type="button" class="btn blue classhour_save-btn">
                                        保存 <i class="fa fa-floppy-o"></i>
                                    </button>
                                    <button type="button" class="btn default" onclick="history.go(-1);">
                                        返回 <i class="fa fa-mail-forward"></i>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>

                <div style="margin-top: 30px;">
                    <table id="classhour-datatable" class="table table-bordered table-hover dataTable">
                        <thead>
                            <th>课时</th>
                            <th>排序</th>
                            <th>创建时间</th>
                            <th>操作</th>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<input type="hidden" class="token_url" value="{:url('admin/Image/token')}">
<input type="hidden" class="record_url" value="{:url('admin/Image/record')}">
<input type="hidden" class="delimage_url" value="{:url('admin/Image/delete')}">

<input type="hidden" class="save_url" value="{:url('admin/microclassroom/addclasshour')}">
<input type="hidden" class="classhourDatalist_url" value="{:url('admin/microclassroom/classhour')}">
<input type="hidden" class="classhourDelete_url" value="{:url('admin/microclassroom/delclasshour')}">

{/block}

{block name="pagescript"}
<script src="__STATIC__/admin/js/qiniu/plupload.full.min.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/qiniu/qiniu.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/qiniu/custom.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/qiniu/qiniuConfig.js" type="text/javascript"></script>

<script src="__STATIC__/admin/pages/js/classhour.js" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/microclassroom.js" type="text/javascript"></script>
{/block}